package cn.dbqn.controller;

import cn.dbqn.entity.Fodderenter;
import cn.dbqn.service.FodderenterService;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class FodderenterController {
    @Resource
    FodderenterService fodderenterService;

    @RequestMapping("/fodderenter")
    public String rc(Model model){
        List<Fodderenter> list=fodderenterService.findAllrk();
        model.addAttribute("list",list);
        return "lyear_js_datepicker";
    }

    @ResponseBody
    @RequestMapping("slrkxx")
    public Object slrkxx(@RequestParam("fputno")Integer fputno){
        Fodderenter slrkxx=fodderenterService.slrkxx(fputno);
        return slrkxx;
    }
}
